<template>

	
  <view class="page-body">
	  
	  <u-navbar :is-back="false" title="任务详情"
	    title-size="30"
	    :background="{background:'#2B88FE' }"
	    title-color="#fff">
	    <div class="head_icon">
	      <u-icon @click="$api.handleBackTo"
	        name="arrow-left" color="#fff"
	        size="36">
	      </u-icon>
	      <u-icon @click="$api.handleHomeTo"
	        name="home" color="#fff" size="36">
	      </u-icon>
	    </div>
	  </u-navbar>
	  
	  
    <order-item :li="info"
      @clickMsg="clickMsg">
      <span slot="footer">
        <view
          class="order-footer"
          v-if="fId">
          <navigator
            class="order-button"
            :url="`/pages/sale/addvisitrecord?fId=${id}&taskId=${fId}`"
            v-if="form.fIsVisit===1">
            添加拜访记录
          </navigator>
          <navigator
            class="order-button"
            :url="`/pages/sale/visit_records_data?fTaskId=${fId}&fMrkId=${id}`"
            v-else>
            查看拜访记录
          </navigator>
          <navigator
            class="order-button"
            :url="`/pages/sale/productstobepurchased?fId=${id}&fTaskId=${fId}`"
            v-if="form.fIsBuy===1">
            进货下单
          </navigator>
        </view>
      </span>
    </order-item>
    <u-form
      label-width="200rpx"
      class="u-form">
      <u-form-item
        label="要求拜访时间">
        {{form.fVisitTime}}
      </u-form-item>
      <u-form-item
        label="任务状态">
        <span
          :class="form.fIsVisit===10?'yi':'wei'">{{form.fIsVisit===10?'已拜访':'未拜访'}}</span>
      </u-form-item>
      <u-form-item
        label="任务说明">
        {{form.fInfo}}
      </u-form-item>
      <u-form-item
        label="创建时间">
        {{form.fCreateTime}}
      </u-form-item>
      <u-form-item
        label="创建人">
        {{form.fUserName}}
      </u-form-item>
    </u-form>
  </view>

</template>

<script>
import orderItem from '@/components/order-item'
export default {
  components: { orderItem },
  data() {
    return {
      form: {},
      info: {},
      id: '',
      fId: ''
    }
  },
  onLoad(e) {
    this.id = e.id
    this.fId = e.fId
    uni.setNavigationBarTitle({
      title: '任务详情'
    })
    this.getInfo()
  },
  methods: {
    clickMsg(e) {
      uni.navigateTo({
        url: '/pages/my_customer/my_customer_client?id=' + this.id + '&taskId=' + this.fId
      })
    },
    getInfo() {
      let that = this
      this.$axios('api/MrkBasic/GetDetail', 'post', { value: this.id }).then(res => {
        // that.isShow = false
        // that.info = res.result
        this.info = res.Value
      })
      this.$axios('api/UserTask/GetDetail', 'post', { value: this.fId }).then(res => {
        this.form = res.Value
      })
    }
  }
}
</script>

<style lang="scss">
.u-form {
  padding: 20rpx 40rpx;
}
.page-body {
  height: 100vh;
  background-color: #fff;
}
.infos {
  padding: 0 48rpx;
  box-sizing: border-box;

  .stit {
    line-height: 100rpx;
    font-size: 32rpx;
    color: #000000;
    font-weight: 600;
    text-align: center;
  }

  .sureBtn {
    background-color: #2b88fe;
    height: 80rpx;
    line-height: 80rpx;
    text-align: center;
    color: #ffffff;
    font-size: 30rpx;
    margin: 30rpx;
  }

  .texts {
    border-radius: 10rpx;
    border: 2rpx solid #d1d1d1;
    padding: 10rpx;
    line-height: 34rpx;
    width: 500rpx;
    margin: 0 auto;
    height: 230rpx;
  }

  .title {
    margin: 40rpx 0;
    font-size: 42rpx;
    font-weight: 500;
    color: #333333;
    line-height: 58rpx;
  }

  .who {
    font-size: 30rpx;
    font-weight: 400;
    color: #2b88fe;
    line-height: 42rpx;
    margin-right: 26rpx;
  }

  .time {
    font-size: 30rpx;
    font-weight: 400;
    color: #999999;
    line-height: 42rpx;
  }
}
</style>
